import java.util.regex.Matcher;
import java.util.regex.Pattern;

/*
purpose find match only a line start 
*/
public class testLookForwardPattern
{
public String datas[]={
"08024 2008-03-03 08 12 17 20 30 01 02 37092316 66940000 0 0 9 271283 35 14117 51 3000 1855 500 7102 200 71356 10 778481 5 0 0 2 162769 7 8470 0 4707 60",
"14116 2014-10-04 06 13 15 24 27 04 05 165743086 797914592 1 10000000 63 120272 802 3672 20831 200 432609 10 4185382 5 0 0 0 0 0 0 21 72163 268 2203 0 0 60\n14117 51 3000 1855 500 7102 200 71356 10 778481 5 0 0 2 162769 7 8470 0 4707 60\n test"
};

public static void main(String[] args)
 {
testLookForwardPattern tfp=new testLookForwardPattern();
for(String data:tfp.datas)
  {
 tfp.testSyntax("14117",data);
}
}
public void testSyntax(String term,String temp)
 {
//String findnewline="^(?<="+term+").*";//(?<=14117).*$\Z
String findnewline="^"+term+".*";//(?<=14117).*$\Z
String findnewline2="\n*\b*"+term+".*";//(?<=14117).*$\Z
String result="";
			Pattern p = Pattern.compile(findnewline, Pattern.MULTILINE);
			Matcher m = p.matcher(temp);
System.out.printf("\t%s \t  %s\n",findnewline,temp);			
			boolean finds=m.find();

 			if(finds)
			{
				int position=m.end();
			   result=temp.substring(position+1);
			 }
 System.out.println("\tfind match group is "+finds);		
 	System.out.println("\n"+result);
 	}
}